


        var originalScrollTop;
        function newsItemInview(){
            for(var n = 0;n < $('.newsList .case .item').length;n++){
                if($('.newsList .case .item')[n].className.indexOf('outView') < 0) continue;
                var itemTop = $('.newsList .case .item')[n].getBoundingClientRect().top;
                if(itemTop < window.innerHeight - 72){
                    $('.newsList .case .item:eq(' + n + ')').removeClass('outView');
                }
            }
        }
        var watchScoll = null;
        $(document).ready(function(){
            originalScrollTop = document.documentElement.scrollTop || document.body.scrollTop;
            var colorBlocks = Math.ceil($('.mainHead .newsList .case')[0].children.length / 2);
            $('.mainHead .newsList .colorBlock div:lt(' + colorBlocks + ')').css('display','block');
            $('.mainHead .newsList .colorBlock div:lt(' + colorBlocks + ')').css('height',(parseInt(100 / colorBlocks) + '%'));
            if(colorBlocks == 3){
                $('.mainHead .newsList .colorBlock div:last-child').css('height',(Math.ceil(100 / colorBlocks) + '%'));
            }
            if(colorBlocks != 2){
                $('.mainHead .pages').addClass('blue');
            }else{
                $('.mainHead .pages').addClass('white');
            }
            newsItemInview();
            watchScoll = setInterval(function(){
                if(!$('.outView').length){
                    clearInterval(watchScoll);
                    watchScoll = null
                }
                var currentScrollTop = document.documentElement.scrollTop || document.body.scrollTop;
                if(currentScrollTop != originalScrollTop){
                    newsItemInview();
                    originalScrollTop = currentScrollTop
                }
            },10)
        })